﻿@inject NetCoreCMS.IServices.IArticle_categoryService _article_category
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>商城分类</title>
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <link href="~/Mobile/css/goods.css" rel="stylesheet" />
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>商城分类</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" asp-controller="Goods" asp-action="Index">
                    <i class="iconfont icon-shopping"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">

            <div class="wy-content">

                <aside>
                    <div class="menu-left scrollbar-none" id="sidebar">
                        <ul>
                            @{
                                var categoryList1 = _article_category.GetChildList(0, 0, 2);
                                int i = 1,j=1;
                            }
                            @foreach (Article_category cdr1 in categoryList1)
                            {
                                if (i == 1)
                                {
                                    <li class="active">@cdr1.title</li>
                                }
                                else
                                {
                                    <li>@cdr1.title</li>
                                }
                                i++;
                            }
                        </ul>
                    </div>
                </aside>
                @foreach (Article_category cdr1 in categoryList1)
                {
                    string disp = "";
                    if (j > 1)
                    {
                        disp = "style=\"display:none\"";
                    }
                    j++;
            <section class="menu-right padding-all j-content" @Html.Raw(disp)>
                @{
                    var categoryList2 = _article_category.GetChildList(0, cdr1.id, 2);
                }                
                <h5><a asp-controller="Goods" asp-action="List" asp-route-id="@cdr1.id" style="color:#808080">@cdr1.title</a></h5>
                    <ul>
                        @foreach (Article_category cdr2 in categoryList2)
                        {
                            <li class="w-3"><a asp-controller="Goods" asp-action="List" asp-route-id="@cdr2.id"></a> <img src="@cdr2.img_url"><span>@cdr2.title</span></li>
                        }
                        </ul>                
                </section>
                    }
                </div>
            <script src="/mobile/js/fastclick.js"></script>
            <script>
                $(function () {
                    FastClick.attach(document.body);
                });
            </script>
            <script type="text/javascript">
                $(function ($) {
                    $('#sidebar ul li').click(function () {
                        $(this).addClass('active').siblings('li').removeClass('active');
                        var index = $(this).index();
                        $('.j-content').eq(index).show().siblings('.j-content').hide();
                    })
                })
            </script>

        </div>
        <!--/页面内容-->

    </div>
</body>
</html>